package exporter;

/**
 * Created by xbkaishui on 16-12-1.
 */
public class Sql {

    public static void main(String [] args ){
        String amtSoSql =
                "SELECT  Code, Market, t_Date, AgencyBuy * 10000, PublicBuy * 10000, AgencySell * 10000, PublicSell * 10000, "
                        + "                AgencyBuySco, AgencySellSco, PriTeamBuySco, PriTeamSellSco, PublicBuySco, "
                        + "                PublicSellSco, AllSco FROM mintMapping.dbo.g_TopViewDataSplit_His "
                        + "                WHERE t_Date >= '20160101' AND t_Date < '20160215' order by t_Date asc ";


//        System.out.println(amtSoSql);


        String klineSql =
                "SELECT\n" + "  Code AS scode,\n" + "  Market AS markettype,\n" + "  T_Date AS tdate,\n"
                        + "  AClose AS atrade,\n" + "  AOpen AS aopen,\n" + "  AHigh AS ahigh,\n"
                        + "  ALow AS alow,\n" + "  AClose AS aclose,\n" + "  YClose AS yclose,\n"
                        + "  Vol AS vol,\n" + "  Amt AS amt,\n" + "  1 AS istrade,\n" + "  CASE\n"
                        + "WHEN(Code LIKE '60%' AND Market = 1)\n" + "OR(Code LIKE '30%' AND Market = 2)\n"
                        + "OR(Code LIKE '00%' AND Market = 2) THEN\n" + "  0\n" + "ELSE\n" + "  1\n"
                        + "END AS isexp,\n" + " CASE\n" + "WHEN(Code LIKE '60%' AND Market = 1)\n"
                        + "OR(Code LIKE '30%' AND Market = 2)\n"
                        + "OR(Code LIKE '00%' AND Market = 2) THEN\n" + "  12\n"
                        + "WHEN(Code LIKE '00%' AND Market = 1)\n"
                        + "OR(Code LIKE '39%' AND Market = 2) THEN\n" + "  11\n" + "ELSE\n" + "  13\n"
                        + "END AS codetyep\n" + "FROM\n" + "  Fbase.dbo.StockHis\n" + "WHERE\n"
                        + "  T_Date < '20160215' and  T_Date > '20160101' ";

//        System.out.println(klineSql);

        String dboSql = "SELECT\n"
                + "\tcode AS code,\n"
                + "\tmarket+1 AS market,\n"
                + "\ttdate AS tdate\n"
                + "FROM\n"
                + "\tmintMapping.dbo.JG_K_SDL  WHERE\n"
                + "\ttdate < '20161107'";
//        System.out.println(dboSql);

        String hisSql = "SELECT\n"
                + "\tCode AS scode,\n"
                + "\tMarket AS market,\n"
                + "\tt_Date AS tdate\n"
                + "\t\tFROM\n"
                + "\t\t\tmintMapping.dbo.g_TopViewDataSplit_His";


        System.out.println(hisSql);
    }

}
